<template>
  <div class="guanlileixing">
    <el-dialog title="发货配置" center :visible.sync="log" width="670px" :close-on-click-modal="false" :close-on-press-escape="false">
      <div style="background: #FFFBE6; border: 1px #FAAD14 solid; padding:10px 20px; margin-bottom: 20px;">
        <i class="el-icon-warning" style="color: #FAAD14;"></i>当前选项在订单获得发货信息后，不会同步电商平台发货，进在敢探号记录为已发货。
      </div>
      <div>
        <div style="font-size: 18px;">
          <el-radio v-model="tuihuox.is_delivery" label="0">关闭发货同步</el-radio>
          <el-radio v-model="tuihuox.is_delivery" label="2">关闭发货同步并自动退款</el-radio>
          <el-radio v-model="tuihuox.is_delivery" label="3">开启同步发货部分自动退款</el-radio>
        </div>



        <div style="margin-top: 30px;">
          <div class="kflexc" style="color: #999; margin: 10px 0 10px 27px;">
            自动退款时间配置：在订单进入{{moban.platform_name}}
            <el-select v-model="tuihuox.refund_time_point" placeholder="请选择" style="width: 120px; margin: 0 10px;">
              <el-option v-for="item in 18" :key="index" :label="item*2" :value="item*2"></el-option>
            </el-select>
            小时后执行自动退款
          </div>
          <div style="color: #999; margin: 10px 0 10px 27px;">商家导入发货信息，电商平台不会发货且在订单进入后的到达指定时间自动在电商平台退（仅加白审核店铺生效）</div>
        </div>

        <div>

        </div>


      </div>
      <div>

      </div>
      <span slot="footer" class="dialog-footer" style="text-align: center;">
        <el-button type="info" round @click="tuihuono">取消</el-button>
        <el-button type="danger" round @click="tuihuogo">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
  import axios from "axios";
  export default {
    name: 'douyinfahuopeizhi',
    data() {
      return {
        log: true,
        tuihuox: {},
        list: []
      }
    },
    created() {


    },
    methods: {
      tuihuono: function() {
        this.list[this.tuihuox.index].is_delivery = 1
        this.tuihuox.fahuolog = false
      },
      tuihuogo: function() {
        axios.post('/api/plan-market/shop/data/syn/set', {
            id: this.tuihuox.id,
            is_delivery: this.tuihuox.is_delivery,
            refund_time_point: this.tuihuox.refund_time_point
          })
          .then(response => {
            if (response.data.msg.code == 0) {
              this.$message.success('操作成功');
              this.getlist()
              this.tuihuox.fahuolog = false
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
      },
    }
  }
</script>

<style lang="scss" scoped>
  .guanlileixing {
    .li {
      background: rgb(245, 251, 255);
      border: 1px solid rgb(25, 137, 250);
      padding: 5px 10px;
      border-radius: 20px;
      margin-right: 20px;
      margin-bottom: 20px;
      color: rgb(3, 127, 255);
    }
  }
</style>
